<?php

namespace App\Http\Controllers\backend;

use App\Models\Feedback;

class FeedbackController extends BaseController {
	
	public function index() {
		$feedbacks = Feedback::orderBy('id', 'desc')->get();
		return view('backend.feedbacks', compact('feedbacks'));
	}
	
	public function finished($id) {
		$feedback = Feedback::find($id);
		$feedback->status = Feedback::STATUS_FINISHED;
		$feedback->save();
		return redirect('backend/feedbacks');
	}
	
	public function destroy($id) {
		$feedback = Feedback::find($id);
		$feedback->delete();
		
		return redirect('backend/feedbacks');
	}
	
}
